package com.demo.controller;

import com.demo.service.MyUdfService;
import com.demo.udf.MyNameUdf;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Classname MyTestController
 * @Description 测试 rest 接口
 * @Date 2023/8/10 9:11
 * @Created by Leo825
 */
@Slf4j
@RestController
public class MyTestController {

    @Resource
    private MyUdfService myUdfService;

    @GetMapping("/test/{id}")
    public String testMethodA(@PathVariable Long id) {
        if (id == 1) {
            log.info("service:" + myUdfService.myName());
            return "测试成功";
        }
        return "测试失败";
    }
}
